From: Florian Müllner Date: Wed, 17 May 2017 22:03:28 +0000 (+0200) Subject: extensionSystem: Handle all initExtension() extension errors X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~223 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e845f4105aa4a8d72109794115c456acda9d17b0;p=gnome-shell.git extensionSystem: Handle all initExtension() extension errors The method currently catches errors that occur when calling the extension's init() method, but throws itself an error if the expected extension.js file is missing. The former is pointless if we expect all callers to handle errors themselves anyway, and we should avoid the latter if we don't - opt for the second option and handle a missing extension.js file gracefully. https://bugzilla.gnome.org/show_bug.cgi?id=781728 --- diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index f25d63ae8..cf501da82 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -218,8 +218,10 @@ function initExtension(uuid) { throw new Error("Extension was not properly created. Call loadExtension first"); let extensionJs = dir.get_child('extension.js'); - if (!extensionJs.query_exists(null)) - throw new Error('Missing extension.js'); + if (!extensionJs.query_exists(null)) { + logExtensionError(uuid, new Error('Missing extension.js')); + return false; + } let extensionModule; let extensionState = null;